package org.cladwell.generaor;

import freemarker.template.TemplateException;
import org.cladwell.model.MainTempalteCOnfig;

import java.io.File;
import java.io.IOException;

public class Maingenerate {
    public static void main(String[] args) throws TemplateException, IOException {
        String projictPath=System.getProperty("user.dir");
        String inputPath=projictPath+ File.separator+"demo"+File.separator+"acm-template";
        String output=projictPath;
        Staticgenerator.CopyFileByHutool(inputPath,projictPath);

//        动态
        String dyprojectpath = System.getProperty("user.dir") + File.separator + "generator-basic";
        String dyinputfile = dyprojectpath + File.separator + "src/main/resources/template/MainTemplate.java.ftl";
        String dyoutpath = dyprojectpath+File.separator + "cbh2.java";
        MainTempalteCOnfig mainTempalteCOnfig = new MainTempalteCOnfig();
        mainTempalteCOnfig.setAuthor("cladwellchen");
        mainTempalteCOnfig.setOutputText("我出来了");
        mainTempalteCOnfig.setLoop(true);
        DynamicGenerator.doGenerate(inputPath,output,mainTempalteCOnfig);
    }
}
